import { defHttp } from '/@/utils/http/axios';
import { IPostIetCategoryUpdateRaw } from '/@/types/system/auxiliary/ietCategory/update';
import {
  IPostIetCategoryListQuery,
  IPostIetCategoryListResponse,
} from '/@/types/system/auxiliary/ietCategory/list';
import { IGetRawIetCategoryDetailsResponse } from '/@/types/system/auxiliary/ietCategory/details';
import { IPostIetCategoryAddRequest } from '/@/types/system/auxiliary/ietCategory/add';

/**
 * 修改收支类别
 */
export const apiPostIetCategoryUpdatePath = (
  id: string | number,
  params: IPostIetCategoryUpdateRaw,
) => defHttp.post({ url: `/system/auxiliary/iet-category/update/${id}`, params });
/**
 * 删除收支类别
 */
export const apiGetIetCategoryDeletePath = (id: string | number) =>
  defHttp.get({ url: `/system/auxiliary/iet-category/delete/${id}` });
/**
 * 收支类别列表
 */
export const apiPostIetCategoryListQuery = (params: IPostIetCategoryListQuery) =>
  defHttp.post<IPostIetCategoryListResponse>({
    url: `/system/auxiliary/iet-category/list`,
    params,
  });
/**
 * 收支类别详情
 */
export const apiGetIetCategoryDetailsPath = (id: string | number) =>
  defHttp.get<IGetRawIetCategoryDetailsResponse>({
    url: `/system/auxiliary/iet-category/details/${id}`,
  });
/**
 * 新增收支类别
 */
export const apiPostIetCategoryAdd = (params: IPostIetCategoryAddRequest) =>
  defHttp.post({ url: `/system/auxiliary/iet-category/add`, params });
